
#ifndef WXSLINEARREGULATOR_H
#define WXSLINEARREGULATOR_H

#include "wxwidgets/wxswidget.h"


class wxsLinearRegulator : public wxsWidget
{
	public:
		wxsLinearRegulator(wxsItemResData* Data);
		virtual ~wxsLinearRegulator();
	protected:
	private:
        virtual void OnBuildCreatingCode();
        virtual wxObject* OnBuildPreview(wxWindow* Parent,long Flags);
        virtual void OnEnumWidgetProperties(long Flags);

		long						m_iValue;							
		long						m_iRangeMin;					
		long						m_iRangeMax;				
		bool						m_bHorizontal;				
		bool						m_bShowVal;					
		bool						m_bShowLimits;				
		wxsColourData	m_cdActiveBarColour;	
		wxsColourData	m_cdPassiveBarColour;
		wxsColourData	m_cdBorderColour;		
		wxsColourData	m_cdLimitTextColour;	
		wxsColourData	m_cdValueTextColour;	
		wxsColourData	m_cdTagColour;				
		wxsFontData		m_fnt;								

        // Dynamic properties.
        
        struct TagDesc{
            wxPGId 	id;													
            int			val;													
        };
        WX_DEFINE_ARRAY(TagDesc*, TagArray);

        TagArray m_arrTags;										
        wxPGId m_TagCountId;									

        void OnAddExtraProperties(wxsPropertyGridManager* Grid);
        void OnExtraPropertyChanged(wxsPropertyGridManager* Grid,wxPGId id);
        bool OnXmlRead(TiXmlElement* Element,bool IsXRC,bool IsExtra);
        bool OnXmlWrite(TiXmlElement* Element,bool IsXRC,bool IsExtra);
		void InsertPropertyForTag(wxsPropertyGridManager* Grid,int Position);
		bool HandleChangeInTag(wxsPropertyGridManager* Grid,wxPGId id,int Position);

};

#endif // WXSLINEARREGULATOR_H
